package com.yanfan.ccapicode.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yanfan.ccapicode.enums.ThirdPartyCloudEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 产品类型映射关系
 * </p>
 *
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ccapi_product_type_mapping")
public class ProductTypeMappingDO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 产品id
     */
    private String productId;

    /**
     * 产品名称
     * */
    @TableField(exist = false)
    private String productName;

    /**
     * 第三方产品名
     */
    private String thirdProduct;

    /**
     * 第三方产品名 - 第二形式
     */
    private String thirdProduct2;

    /**
     * 第三方产品id
     */
    private String thirdProductId;

    /**
     * 第三方品牌
     */
    private String thirdBrand;

    /**
     * 语音平台
     */
    private ThirdPartyCloudEnum thirdPartyCloud;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private String thirdPartyCloudCode;

    @TableField(exist = false)
    private List<String> productIds;

    public String getThirdPartyCloudCode() {
        if (thirdPartyCloud == null) {
            return null;
        }
        return thirdPartyCloud.toString();
    }
}
